<template>
  <div>
    <div
      class="one"
      v-for="item in list"
      :key="item.id"
      @click="getDetails(item, item.id)"
    >
      <div class="one-left">
        <img :src="item.pic" alt="" />
      </div>
      <div class="one-right">
        <p v-html="item.name"></p>
        <p class="ellipsis">{{ item.characteristic }}</p>
        <ul>
          <li>
            <p class="p1">￥{{ item.minPrice }}</p>
            <p class="p2">低价</p>
          </li>
          <li>
            <p>{{ item.minBuyNumber }}</p>
            <p>原价</p>
          </li>
          <li>
            <p>{{ item.stores }}件</p>
            <p>限量</p>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    list: {
      type: Array,
      defalut: () => {
        return [];
      },
    },
  },
  data() {
    return {};
  },
  created() {},
  methods: {
    // 点击谁把ID传过去
    getDetails(a, id) {
      this.$router.push({
        path: "/argainDetails",
        query: {
          id,
        },
      });
    },
  },
  //组件挂载
  components: {},
  //计算属性
  computed: {},
  //过滤器
  filters: {},
};
</script>

<style lang="scss" scoped>
.one {
  width: 100%;
  border-top: 1px solid #eee;
  height: 2.4rem;
  background-color: #fff;
  box-sizing: border-box;
  .one-left {
    width: 30%;
    height: 100%;
    padding: 0.1rem;
    float: left;

    img {
      border-radius: 0.12rem;
      display: block;
      height: 100%;
      width: 100%;
    }
  }

  .one-right {
    width: 70%;
    float: left;
    font-size: 0.28rem;
    padding-left: 0.2rem;
    .ellipsis {
      width: 100%;
      font-size: 0.24rem;
      height: 0.28rem;
      color: #ccc;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    p {
      margin: 0.13rem 0;
    }
    li {
      margin-top: 0.3rem;
      width: 1.4rem;
      float: left;
      font-size: 0.24rem;
      color: #b2b2b2;
      .p1 {
        color: red;
      }
      .p2 {
        color: #000;
      }
    }
  }
}
</style>
